//
//  HerosTableViewCell.m
//  LOLProject
//
//  Created by SXW on 16/3/25.
//  Copyright © 2016年 盛宣伟. All rights reserved.
//

#import "HerosCollectionViewCell.h"
static CGFloat CELL_HEIGHT = 70;

@interface HerosCollectionViewCell ()

@end

@implementation HerosCollectionViewCell

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self)
    {
        _imageView  = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 80, 90)];
        _imageView.backgroundColor = [UIColor blackColor];
        [self.contentView addSubview:_imageView];
        
        _nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(_imageView.frame)+ 3, 80, 17)];
        _nameLabel.textAlignment = NSTextAlignmentCenter;
        _nameLabel.textColor = [UIColor colorFromHexRGB:@"000000"];
        _nameLabel.font = [UIFont systemFontOfSize:14];
        [self.contentView addSubview:_nameLabel];
        
        _nickNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(_nameLabel.frame) + 2, 80, 10)];
        _nickNameLabel.textColor = [UIColor colorFromHexRGB:@"000000"];
        _nickNameLabel.font = [UIFont systemFontOfSize:13];
        _nickNameLabel.textAlignment = NSTextAlignmentCenter;
        [self.contentView addSubview:_nickNameLabel];
    }
    return self;
}
//cell设置
-(void)configData:(HeroModel *)dataModel{
    
    [_imageView sd_setImageWithURL:[NSURL URLWithString:dataModel.img] placeholderImage:[UIImage imageNamed:@"default_head"]];
    _nameLabel.text = dataModel.name;
    _nickNameLabel.text = dataModel.nickName;
    
}

@end
